# Contributor: Philipp Glaum <p@pglaum.de>
# Maintainer: Dhruvin Gandhi <contact@dhruvin.dev>
pkgname=todoman
_pyname=todoman
pkgver=4.1.0
pkgrel=1
pkgdesc="A simple CalDav-based todo manager"
url="https://pypi.org/project/todoman/"
arch="noarch"
license="ISC"
depends="
	python3
	py3-atomicwrites
	py3-click
	py3-click-log
	py3-dateutil
	py3-humanize
	py3-icalendar
	py3-parsedatetime
	py3-urwid
	py3-xdg
	"
makedepends="
	py3-setuptools
	py3-setuptools_scm
	py3-sphinx
	py3-sphinx-autorun
	py3-sphinx-click
	py3-sphinx_rtd_theme
	"
checkdepends="
	py-tox
	py3-flake8
	py3-flake8-import-order
	py3-freezegun
	py3-hypothesis
	py3-pytest
	py3-pytest-cov
	py3-pytest-runner
	"
subpackages="$pkgname-doc $pkgname-bash-completion $pkgname-zsh-completion"
source="https://files.pythonhosted.org/packages/source/${_pyname:0:1}/$_pyname/$_pyname-$pkgver.tar.gz"

build() {
	python3 setup.py build
	make -C docs man PYTHONPATH="$PWD"
}

check() {
	TOX_TESTENV_PASSENV=PYTHONPATH PYTHONPATH=. \
		tox --sitepackages
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
	install -Dm644 docs/build/man/todo.1 "$pkgdir"/usr/share/man/man1/todo.1
	install -Dm644 contrib/completion/bash/_todo \
		"$pkgdir"/usr/share/bash-completion/completions/_todo
	install -Dm644 contrib/completion/zsh/_todo \
		"$pkgdir"/usr/share/zsh/site-functions/_todo
}

sha512sums="
3e4789470794baf692a3d3d51952fafc35a18de40f4ddbf705b960208e8c4f406c3ea8adbd910d1bb603ef594346d57b18d698651c159e53068ca35ace23353b  todoman-4.1.0.tar.gz
"
